import {PageContainer} from "@ant-design/pro-layout";
import {useEffect, useState} from "react";
import {integralConfigure} from "@/services/ant-design-pro/marketing";
import {Form,Card,Radio} from "antd";

const Configuration = () => {
  const [configure,setConfigure] = useState([])

  useEffect(async ()=>{
    const configure = await integralConfigure()
    setConfigure(configure)
    console.log(configure)
  },[])

  return (
    <PageContainer
      header={{
        breadcrumb: {},
      }}
    >
      <Card>
        <Form>
          {
            configure.map(item=>{
              console.log(item)
              return (
                <Form.Item
                  key={item.id}
                  label={item.info}
                  tooltip={item.desc}
                >
                  {
                    item.type === 'text' ? <input type="text" /> : <Radio.Group>
                      <Radio value={item.status}>item 1</Radio>
                    </Radio.Group>
                  }
                </Form.Item>
              )
            })
          }
        </Form>
      </Card>
    </PageContainer>
  );
}

export default Configuration;
